/**
 * Project Name:cats-core-impl
 * File Name:CatsicException.java
 * Package Name:com.catsic.core.exception
 * Date:2014年2月28日上午9:04:49
 * Copyright (c) 2014, oa.catsic.com All Rights Reserved.
 */

package com.catsic.base.exception;

import com.catsic.base.utils.SpringContextUtil;

/**
 * ClassName: CatsicException Description: 异常类 date: 2014年2月28日 上午9:04:49
 * author: yangyd
 */
public class CatsicException extends RuntimeException {

	/**
	 * serialVersionUID:
	 */
	private static final long serialVersionUID = 3776449414775909590L;

	/**
	 * 错误码
	 */
	private String code;
	/**
	 * 错误信息参数
	 */
	private Object[] params;
	
	/**
	 * @param code 错误码
	 */
	public CatsicException(String code){
		super(SpringContextUtil.getMessage(code));
		this.code = code;
	}
	
	/**
	 * @param code 错误码
	 * @param params 错误信息参数
	 */
	public CatsicException(String code, Object... params){
		super(SpringContextUtil.getMessage(code, params));
		this.code = code;
		this.params = params;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Object[] getParams() {
		return params;
	}

	public void setParams(Object[] params) {
		this.params = params;
	}
}
